import os
import shutil
import tempfile
from unittest import TestCase

from pechapub.util import TempResources


class BaseTestCase(TestCase):

    def setUp(self):
        super(BaseTestCase, self).setUp()
        self._temp_resources = TempResources()

    def tearDown(self):
        super(BaseTestCase, self).tearDown()
        self._temp_resources.clean_up()

    def make_temp_file(self):
        return self._temp_resources.get_file()

    def make_temp_dir(self):
        return self._temp_resources.get_dir()
